import importlib

from raw.base_model import BaseModel

def get_model(name, options = {}):
    model = importlib.import_module('raw.models.' + name).Model(options)
    assert isinstance(model, BaseModel), 'Model class must extend raw.base_model.BaseModel'
    assert model.model_name == name, 'Model name must be the same as its file name'
    return model.to_device()
